Button Customization

Override the Delete Button Handler

Code Customization
Override the Delete Button Handler
Description:

In some cases, it is useful to intercept record deletions in your generated application. For example, suppose you do not want certain selected records to be deleted when your user clicks the "Delete" button? One way to accomplish this is to override the DeleteButton_Click() button handler method. For example, we can check Order records' postal code when the user select the records, and clicks the "Delete" button. If a record contains the postal code as "11111", then the deletion of that record is cancelled, an error message is displayed, and remaining records are deleted; otherwise, all the selected records are deleted.

This example code customization checks for a field's value. If the field's value matches some value like "11111" then, deletion of the record is cancelled. It also provides an error message, and if there is any other selected records, their deletion process will continue.

For a Web Application the customization will be added in:

..\<Application Name>\<Table Name>\Show<Table Name>Table.Controls.cs

For example: C:\MyApp1\Orders\ShowOrdersTable.controls.cs


For a Web Site the customization will be added in:

..\<Application Name>\App_Code\<Table Name>\Show<Table Name>Table.Controls.cs

For example: C:\MyApp1\App_Code\Orders\ShowOrdersTable.controls.cs

Procedure:

Step 1:  Use this wizard to add code customization.

Step 2:  Build and run the application.

Applies To:

This customization is applicable only to a show or editable table control.

Disclaimer:
Customizations included in this wizard are provided as a sample to demonstrate a feature, and may work only in specific situations. The Iron Speed Designer support team cannot assist in the resolution of problems which may occur as a result of customizing your application or modifying a customization to fit a particular purpose.

Terms of Service Privacy Statement